import {baseUrl} from "@/config/env";

export default () => {
    return {
        submitText: '修改',
        size: 'small',
        labelWidth: 120,
        index: true,
        indexLabel: "序号",
        menuType: 'menu',
        menuAlign: 'center',
        menuPosition: "right",
        searchIndex: 1,
        searchIcon: true,
        permissionBtn: {
            addBtn: 'tpp:thirdPartyPlatformConfig:add',
            editBtn: 'tpp:thirdPartyPlatformConfig:edit',
            viewBtn: 'tpp:thirdPartyPlatformConfig:info',
            delBtn: 'tpp:thirdPartyPlatformConfig:delete',
            changeEnableBtn: 'tpp:thirdPartyPlatformConfig:changeEnable',
            platformMigrationBtn: 'tpp:thirdPartyPlatformConfig:platformMigration',
        },
        column: [{
            "addDisplay": false,
            "editDisplay": false,
            "label": "id",
            "prop": "id",
            "hide": true,
            "type": "input"
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "名称",
            "prop": "name",
            "showColumn": true,
            "type": "input",
            rules: [
                {
                    required: true,
                    trigger: "blur"
                }
            ]
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "平台类型",
            "prop": "platformType",
            "showColumn": true,
            "type": "tree",
            dicUrl: baseUrl + "/start/sysDictionaryItem/listByDictionaryCode",
            dicQuery: {
                code: "third:party:platform:configs",
            },
            parent: false,
            props: {
                label: "name",
                value: "dictionaryValue"
            },
            rules: [
                {
                    required: true,
                    trigger: "blur"
                }
            ]
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "AppId",
            "prop": "appId",
            "showColumn": true,
            "type": "input",
            rules: [
                {
                    required: true,
                    trigger: "blur"
                }
            ]
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "secret",
            "prop": "secret",
            "showColumn": true,
            "type": "input",
            rules: [
                {
                    required: true,
                    trigger: "blur"
                }
            ]
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "token",
            "prop": "token",
            "showColumn": true,
            "type": "textarea",
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "证书",
            "prop": "cert",
            "showColumn": true,
            "type": "upload",
            action: `${baseUrl}/start/staticResources/upload?hexName=false`,
            propsHttp: {
                name: 'fileName',
                res: 'data',
                url: 'fileUrl',
            },
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "aes_key",
            "prop": "aesKey",
            "showColumn": true,
            "type": "input"
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "消息类型",
            "prop": "msgDataFormat",
            "showColumn": true,
            "type": "input"
        }, {
            "addDisplay": false,
            "editDisplay": false,
            "label": "创建人",
            "prop": "createBy",
            "hide": true,
            "type": "input"
        }, {
            "addDisplay": false,
            "editDisplay": false,
            "label": "创建时间",
            "prop": "createTime",
            "hide": true,
            "type": "datetime"
        }, {
            "addDisplay": false,
            "editDisplay": false,
            "label": "修改人",
            "prop": "updateBy",
            "hide": true,
            "type": "input"
        }, {
            "addDisplay": false,
            "editDisplay": false,
            "label": "修改时间",
            "prop": "updateTime",
            "hide": true,
            "type": "datetime"
        },

        ]

    }
}
